package com.j283_5.wisdom_park.controller.confcenter_management.orgmanage;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.j283_5.wisdom_park.common.result.ResultData;
import com.j283_5.wisdom_park.pojo.Orgmanage;
import com.j283_5.wisdom_park.pojo.Roleinfo;
import com.j283_5.wisdom_park.service.OrgmanageService;
import com.j283_5.wisdom_park.vo.confcenter_management.OrgManageVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/orgmanage")
@Api(value = "组织信息管理",tags = "组织信息管理",produces = "罗移筵")
public class OrgmanageController {
    @Resource
    private OrgmanageService orgmanageService;

    /**
     * 查询所有组织信息
     * @param page
     * @param orgmanage
     * @return
     */
    @RequestMapping(value = "/orgManageList",method = RequestMethod.GET)
    @ApiOperation(value = "查询所有组织信息信息",notes = "查询所有组织信息信息（分页）",produces = "罗移筵",response = ResultData.class)
    public ResultData getOrgManage (@Param("page") Page<Orgmanage> page, Orgmanage orgmanage){
       return orgmanageService.getOrgManage(page,orgmanage);
    }

    /**
     * 添加组织信息
     * @param orgManageVo
     * @return
     */
    @RequestMapping(value = "/addOrgManage",method = RequestMethod.POST)
    @ApiOperation(value = "添加组织信息",notes = "添加组织信息",produces = "罗移筵",response = ResultData.class)
    public ResultData addOrgManage(@RequestBody OrgManageVo orgManageVo){
        return orgmanageService.addOrgManage(orgManageVo);
    }

    /**
     * 删除角色信息
     * @param orIdlist
     * @return
     */
    @RequestMapping(value = "/deleteOrgManage",method = RequestMethod.POST)
    @ApiOperation(value = "删除组织信息",notes = "删除组织信息",produces = "罗移筵",response = ResultData.class)
    public ResultData deleteOrgManage(@RequestBody ArrayList<Integer> orIdlist){
        return orgmanageService.deleteOrgManage(orIdlist);
    }

    /**
     * 修改角色信息
     * @param orgmanage
     * @return
     */
    @RequestMapping(value = "/updateorgmanage",method = RequestMethod.POST)
    @ApiOperation(value = "修改角色信息",notes = "修改角色信息",produces = "罗移筵",response = ResultData.class)
    public ResultData updateorgmanage(@RequestBody Orgmanage orgmanage){
        return orgmanageService.updateorgmanage(orgmanage);
    }
}
